<?php
class Cl_UserLogin extends WdkClass 
{
	protected
		/******************************************************/
		//	원본 테이블 정보
		/******************************************************/
		$fk_user_seq		= 0		,	//	사용자 키값
		$user_login_ip		= ''	,	//	로그인 IP
		$user_login_time	= ''	;	//	로그인 시간
		/******************************************************/
		//	추가 정보
		/******************************************************/
	
	/**
	 * 	
	 */
	function __construct()
	{
		parent::__construct();
		self::getDbo();
	}
	
	/**
	 *	
	 */
	public function __init($data)
	{
		parent::__init($data);
		self::dformat();
	}
	
	/**
	 *	
	 */
	public function load($user_seq)
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/
		self::__init($dbo->cLoad($user_seq));
	}
	
	/**
	 *	
	 */
	public function dformat()
	{
	
	}
	
	/**
	 *	
	 */
	public function insert()
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/
		$this->user_login_time		= time();
		
		$data = array(	'fk_user_seq'		=>	$this->fk_user_seq,
						'user_login_ip'		=>	isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1',
						'user_login_time'	=>	$this->user_login_time
					);
		$dbo->insert($data);
	}
	
	/**
	 * 
	 */
	public function update($log='update')
	{
		throw new MethodNotImplementedException();
	}
	
	/**
	 * 
	 */
	public function delete($log='delete')
	{
		throw new MethodNotImplementedException();
	}
	
	/**
	 *	
	 */
	private function backup($log='')
	{
		throw new MethodNotImplementedException();
	}
	
	/**
	 * 
	 */
	public function getDbo()
	{
		return Wdk::model(substr(__CLASS__, 3));
	}
}